﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;

namespace Janus.NorthwindDemo2007
{
	public class OrdersFolder : ApplicationFolder
	{

		private const string cFolderName = "Orders";
        private const string cFolderDescription = "Đơn hàng";
		public OrdersFolder()
		{
            mFolderDescription = cFolderDescription;
			mFolderName = cFolderName;
			this.mSupportedFeatures = FolderFeatures.MultipleViews | FolderFeatures.NewItem;
			this.ImageKey= "Orders";
            this.mEditImageKey = "EditOrder";
            this.mNewImageKey = "NewOrder";
            
		}


		protected override FolderView DefaultView
		{
			get
			{
				return Views[3];
			}
		}
		protected override Type GetTypeOfView(ContentViewType viewType)
		{
			switch (viewType)
			{
				case ContentViewType.GridView:
					return typeof(OrdersGridEXView);
				case ContentViewType.TimelineView:
					return typeof(OrdersTimelineView);
				default:
					return base.GetTypeOfView(viewType);
			}
		}

		protected override DataProvider CreateDataProvider()
		{
			return new OrdersDataProvider();
		}
        public override bool CanAdd
        {
            get
            {
                return true;
            }
        }
		public override void AddNew()
		{
			OrderDataForm frmNew = new OrderDataForm();
			frmNew.Edit(null);
		}
	}

} //end of root namespace